package com.icode.core.model.house;

import com.icode.core.model.AbstractEntity;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-3-2
 * Time: 上午11:22
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "home_info_image")
public class HomeInfoImage extends AbstractEntity {

    @ManyToOne
    @JoinColumn(name = "home_page_id")
    private HomePage homePage;

    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "home_images_id")
    private UploadImage image;

    public HomeInfoImage() {
    }

    public HomeInfoImage(HomePage homePage, UploadImage image) {
        this.homePage = homePage;
        this.image = image;
    }

    public HomePage homePage() {
        return homePage;
    }

    public UploadImage image() {
        return image;
    }
}
